<?php
/**
 * Created by PhpStorm.
 * User: alice
 * Date: 2015/12/26
 * Time: 14:14
 */

/**
 * Class Involved_LineChartModel
 */
class Involved_LineChartModel extends BaseModel
{

    protected $table = 'line_chart';

    /**
     * 折线图信息
     * @param $user_id
     * @return mixed
     */
    public function LineChart($user_id)
    {
        return DB::table($this->table)
            ->select('year', 'month', 'wait_money')
            ->where(['user_id' => $user_id])
            ->get();
    }
    public function UserAccountChart($user_id,$year)
    {
        return DB::table($this->table)
            ->select('year', 'month', 'wait_money')
            ->where(['user_id' => $user_id,'year'=>$year])
            ->get();
    }
    /**
     * 锁定表
     */
    public function linechartpay($user_id,$yesr,$month)
    {
        return DB::table($this->table)
             ->where(['user_id'=>$user_id,'year'=>$yesr,'month'=>$month])
            ->count();
    }

     /**
     * 锁定表
     */
    public function linechartone($user_id,$yesr,$month)
    {
        return DB::table($this->table)
            ->where(['user_id'=>$user_id,'year'=>$yesr,'month'=>$month])
            ->first();
    }

}